home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / GoldED Tools / Macro Collection / Oberon / OC.ged < prev    next >
Encoding:
Text File  |  1996-09-27  |  2.0 KB  |  80 lines

  1. /*
  2. ** $VER: OC 0.005 (26 Sep 1994) Sep 1994) ***
  3. **
  4. ** (c) © 1994 Oliver Clouth
  5. **
  6. ** Function : Compilieren
  7. **
  8. **
  9. */
  10.  
  11.  
  12. OPTIONS RESULTS                             /* enable return codes     */
  13.  
  14. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  15.     address 'GOLDED.1'
  16.  
  17. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  18. OPTIONS FAILAT 6                            /* ignore warnings         */
  19. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  20.  
  21. host = ADDRESS()                              /* get GED's port    */
  22.  
  23. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  24.  
  25. 'QUERY CAT'
  26. isGerman = (result = "deutsch")
  27.  
  28. 'QUERY ANYTEXT'
  29.  
  30. if (result = 'TRUE') then 
  31.  
  32.     do
  33.         'QUERY DOC VAR OLDNAME'             /* remember current file name */
  34.         
  35.         'QUERY PATH Var PFAD'
  36.         'QUERY FILE VAR FNAME'              /* Nur den Filenamen in Var FNAME */
  37.        
  38.           Name = left(FNAME, Pos('.', FNAME) - 1)
  39.  
  40.         call pragma 'D', PFAD    /* Aktuelles Verzeichnis wechseln */
  41.  
  42.         Code = EXISTS(Code)
  43.  
  44.         if (Code) then
  45.         do
  46.           say
  47.           say 'Das Unterverzeichnis »' PFAD'/Code « ist schon vorhanden !'
  48.           say
  49.           shell
  50.           call pragma 'Stack', 10000
  51.           'Oberon-A:C/OC NS SYM Code/ DST Code/ DEBUG' Name'.mod'
  52.         end
  53.         else do
  54.           say
  55.           say 'Mußte das Unterverzeichnis »' PFAD'/Code « anlegen !!'
  56.           say
  57.           call pragma 'Stack', 10000
  58.           shell
  59.           'Makedir Code'
  60.           'Oberon-A:C/OC NS SYM Code/ DST Code/ DEBUG' Name'.mod'
  61.         end
  62.  
  63.         ok = (RC = 0)
  64.  
  65.         shell                               /* address host (GoldED) */
  66.  
  67.         'NAME NEW ' || oldname              /* restore old file name */
  68.     end
  69.  
  70. else do
  71.  
  72.     if (isGerman) then
  73.         'REQUEST BODY="Kein Text vorhanden ?!"'
  74.     else
  75.         'REQUEST BODY="Text buffer is empty ?!"'
  76. end
  77.  
  78. 'UNLOCK' /* VERY important: unlock GUI */
  79. Exit
  80.